<template>
  <div class="notice" :style="'padding: ' + data.p_t / 2 + 'px ' + data.p_lr / 2 + 'px ' + data.p_b / 2 + 'px'">
    <div class="bg" :style="'background:' + data.bg_color + ';border-radius:' + data.r_t / 2 + 'px ' + data.r_t / 2 + 'px ' + data.r_b / 2 + 'px ' + data.r_b / 2 + 'px '">
      <div class="notice-icon-box"><i :style="'color:'+data.icon_color" :class="'icon-box ' + data.icon"></i></div>
      <div class="notice-box">
        <div class="notice-swiper" style="flex: 1 1 0%;">
          <el-carousel :interval="interval" indicator-position="none" height="33px" direction="vertical" :autoplay="true">
            <el-carousel-item v-for="(item,i) in data.list" :key="i"><span class="info" :style="'color:' + data.text_color">{{item.title}}</span></el-carousel-item>
          </el-carousel>
        </div>
        <i class="el-sc-gengduo icon" :style="'color:'+data.icon_color"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default: {}
    }
  },
  computed: {
    interval() {
      return this.data.interval * 1000;
    }
  },
 
};
</script>

<style lang="scss" scoped>
.notice {
  width: 100%;
  padding: 0 12px;
  overflow: hidden;
  .bg {
    height: 33px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    margin: 0 auto;
    padding: 0 12px;
    border-radius: 6px;
    .notice-icon-box {
      display: flex;
      align-items: center;

      .icon-box {
      }
    }
    .notice-box {
      flex: 1;
      width: 0;
      display: flex;
      flex-wrap: nowrap;
      padding: 4px 8px;
      position: relative;
      .info {
        font-size: 12px;
        line-height: 25px;
      }
    }
    .icon {
      font-size: 16px;
      line-height: 16px;
      height: 16px;
      position: absolute;
      z-index: 10;
      top: 9px;
      right: 8px;
    }
  }
}
</style>
